package com.github.xiaolyuh.constant;

/**
 * 缓存常量
 *
 * @author xuwanglong
 */
public class CacheConstant {

    /**
     * 字符集编码
     */
    public static final String UTF_8 = "UTF-8";

    /**
     * 分隔符
     */
    public static final String SEPARATOR_CHARACTER = ":";

    /**
     * 缓存默认过期时间(72小时，单位：秒)
     */
    public static final int CACHE_DEFAULT_TIMEOUT = 72 * 60 * 60;

    /**
     * 缓存默认过期时间(7天，单位：秒)
     */
    public static final int LOCAL_CACHE_DEFAULT_TIMEOUT = 7 * 24 * 60 * 60;

    /**
     * 24小时(单位：秒)
     */
    public static final int TWENTY_FOUR_HOUR_TIME = 24 * 60 * 60;

    /**
     * 1分钟(单位：秒)
     */
    public static final int ONE_MINUTE_TIME = 60;

    /**
     * 空值
     */
    public static final String NIL_STRING = "nil";

    /**
     * 空值
     */
    public static final byte[] NIL_BYTES = "nil".getBytes();

    /**
     * ALL:店铺、分类、商品、品牌ALL
     */
    public static final String ALL = "ALL";

    /**
     * redis result ok
     */
    public static final String REDIS_RESULT_OK = "OK";

    /**
     * 字符串分割
     */
    public static final String COMMA = ",";

    /**
     * 默认分割线
     */
    public static final String DEFAULT_LINE = "-";

    /**
     * 下划线
     */
    public static final String UNDER_LINE="_";

    /*
     * ------------------------------coupon------------------------------
     */

    /**
     * 表示所有的数字常量标识
     */
    public static final Number DEFAULT_NUMBER_ALL = -10000;

    /**
     * 系统coupon
     */
    public static final String SYSTEM_COUPON = "-1";

    /**
     * 普通coupon
     */
    public static final String NORMAL_COUPON = "0";

    /**
     * coupon可用店铺前缀
     */
    public static final String COUPON_SHOP_INFO = "promo:cs:";

    /**
     * coupon可用商品前缀
     */
    public static final String COUPON_GOOD_INFO = "promo:cg:";

    /**
     * coupon key前缀
     */
    public static final String PROMOTION_COUPON = "promo:c:";

    /**
     * 模板对应coupon key前缀
     */
    public static final String PROMOTION_TEMPLATE_COUPON = "promo:t:";

    /**
     * 店铺对应系统coupon key前缀
     */
    public static final String PROMOTION_SHOP_TEMPLATE_COUPON = "promo:s:c";

    /**
     * 用户绑定的coupon 可用
     */
    public static final String USER_COUPON_INFO_AVAILABLE = "promo:u:c:";

    /**
     * 预生成券码
     */
    public static final String COUPON_PRE_BUILD_KEY="promo:u:c:b";

    /*
     * ------------------------------local cache config------------------------------
     */

    /**
     * 本地缓存长度
     */
    public static final String COUPON_LOCAL_CACHE_NORMAL_COUPON_LENGTH = "promotion.cache.local.coupon.normal.length";

    /**
     * 本地缓存长度
     */
    public static final String COUPON_LOCAL_CACHE_SYSTEM_COUPON_LENGTH = "promotion.cache.local.coupon.system.length";

    /**
     * 本地缓存超时时间
     */
    public static final String COUPON_LOCAL_CACHE_EXPIRE = "promotion.cache.local.expire";

    /**
     * 本地缓存开关
     */
    public static final String COUPON_LOCAL_CACHE_ALLOW = "promotion.cache.local.allow";

    /**
     * redis key 版本号
     */
    public static final String REDIS_KEY_VERSION_LIST = "promotion:cache:key:version";

    /**
     * 营销活动key前缀
     */
    public static final String PROMOTION_ACTIVITY = "promo:a";

    /**
     * 活动类型优先级排序
     */
    public static final String ACTIVITY_TYPE_PRIORITY = "promo:a:pri";

    /**
     * 营销仓库活动商品key前缀
     */
    public static final String ACTIVITY_WAREHOUSE_GOODS = "promo:a:w:g";

    /**
     * 店铺可参与活动key前缀
     */
    public static final String PROMOTION_ACTIVITY_SHOP = "promo:a:s";

    /**
     * 本地缓存长度:活动
     */
    public static final String COUPON_LOCAL_CACHE_ACTIVITY_LENGTH = "promotion.cache.local.activity.length";

    /**
     * 本地缓存长度:活动索引
     */
    public static final String COUPON_LOCAL_CACHE_ACTIVITY_INDEX_LENGTH = "promotion.cache.local.activity.index.length";

    /**
     * 活动不带状态的key的前缀
     */
    public static final String PROMOTION_ACTIVITY_WITHOUT_STATUS = "promo:a:ws";

    /**
     * 站点编码列表
     */
    public static final String PROMOTION_LOCAL_CACHE_SITE_CODES = "promotion.cache.local.siteCode";

    /**
     * 默认站点编码
     */
    public static final String DEFAULT_SITE_CODE = "GB";

    /**
     * redis 消息确认机制的key前缀
     */
    public static final String PROMOTION_REDIS_MSG_ACK = "promo:msg:ack";

    /**
     * 配置中心营销soa机器数量
     */
    public static final String PROMOTION_SOA_IP_NUM="promotion.soa.ip.num";

    /**
     * 刷新本地缓存默认的redis消息队列
     */
    public static final String DEFAULT_CHANNEL="refreshLocalCache_PROMOTION";
}